package service;

import com.root.health.bean.MedicineInfo;
import com.root.health.mapper.MedicineMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MedicineService {
    @Autowired
    MedicineMapper medicineMapper;
    public void medicineInfo(String medName, String medEffort, String taboo, String indate,String dosage,String specification,long userId){
        medicineMapper.medicine(medName, medEffort, taboo, indate,dosage,specification,userId);
    }
    public MedicineInfo medByName(String medName,long userId){

        return medicineMapper.medByname(medName,userId);
    }
    public MedicineInfo medById(long medId){
        return medicineMapper.medById(medId);
    }
    //以药品id查询药品信息
    public List<MedicineInfo> selectMed(long userId){

        return medicineMapper.selectMed(userId);
    }
    public void deleteMed(long medId){
        medicineMapper.medDelete(medId);
    }
    public void medUpdate(String medName, String medEffect, String taboo, String indate,String dosage,String specification,long medId){
        medicineMapper.medUpdate(medName,medEffect,taboo,indate,dosage,specification,medId);
    }
}
